﻿package com.zit.presentation.action;

import java.util.List;

import com.zit.entity.Profession;
import com.zit.service.ProfessionService;

/**
 * 功能：专业管理
 * @author 唐美兰
 * @createTime 2013-12-3
 */
public class ProfessionAction extends BaseAction {

	private ProfessionService professionService = new ProfessionService();
	
	//查询专业所得的集合
	private List<Profession> professions;
	
	//传入需要添加或修改的专业对象
	private Profession profession;
	
	/**
	 * 功能:查询所有的专业
	 * @return
	 */
	public String showprofession(){
		professions = professionService.showprofession();
		return "show";
	}
	
	/**
	 * 功能：添加专业
	 * @return
	 */
	public String addprofession(){
		if(profession!=null){
			professionService.addprofession(profession);
			return "add";
		}
		return "addinput";
	}
	
	/**
	 * 功能：修改专业的专业名
	 * @return
	 */
	public String updateprofession(){
		professionService.updateprofession(profession);
		return "update";
	}

	public List<Profession> getProfessions() {
		return professions;
	}

	public void setProfessions(List<Profession> professions) {
		this.professions = professions;
	}

	public Profession getProfession() {
		return profession;
	}

	public void setProfession(Profession profession) {
		this.profession = profession;
	}
	
}
